﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSM_SQL
{
    public class OrderMes
    {
        public Goods goods { get; set; }
        public Order order { get; set; }
        public Customer customer { get; set; }
        public Assess assess { get; set; }
        public string postName { get; set; }
        public string postPhone { get; set; }

        public Cus_Ord TransCusOrd()
        {
            Cus_Ord c = new Cus_Ord
            {

                state = this.order.State,
                goodsName = this.goods.Name,
                amount = this.order.Amount,
                startTime = this.order.StartTime.ToString(),
                endTime = this.order.EndTime.ToString(),
                postName = this.postName,
                postPhone = this.postPhone
            };

            return c;
        }

        public Emp_Ord TransEmpOrd()
        {
            Emp_Ord e = new Emp_Ord
            {
                id = this.order.ID,
                state = this.order.State,
                goodsName = this.goods.Name,
                amount = this.order.Amount,
                startTime = this.order.StartTime.ToString(),
                endTime = this.order.EndTime.ToString(),
                customer = this.customer.Name,
                phone = this.postPhone,
                address = this.customer.Address
            };
            return e;
        }

        public AssessMsg TransAssMsg()
        {
            AssessMsg a = new AssessMsg
            {
                customer = this.customer.Name,
                goodsName = this.goods.Name,
                amount = this.goods.Price * this.order.Amount,
                goodsType = this.goods.Type,
                postName = this.postName,
                startTime = this.order.StartTime,
                endTime = this.order.EndTime
            };
            return a;
        }
    }

    //用户端信息
    public class Cus_Ord
    {
        public int? state { get; set; }
        public string goodsName { get; set; }
        public int? amount { get; set; }
        public string startTime { get; set; }
        public string endTime { get; set; }
        public string postName { get; set; }
        public string postPhone { get; set; }
        public int? grade { get; set; }
        public string assess { get; set; }

    }

    //员工端信息
    public class Emp_Ord
    {
        public int id { get; set; }
        public int? state { get; set; }
        public string goodsName { get; set; }
        public int? amount { get; set; }
        public string startTime { get; set; }
        public string endTime { get; set; }
        public string customer { get; set; }
        public string address { get; set; }
        public string phone { get; set; }
        public int? grade { get; set; }
        public string assess { get; set; }
    }
    
    public class AssessMsg
    {
        public string goodsName { get; set; }
        public int? goodsType { get; set; }
        public decimal? amount { get; set; }
        public string customer { get; set; }
        public string postName { get; set; }
        public int? grade { get; set; }
        public string assess { get; set; }
        public DateTime? startTime { get; set; }
        public DateTime? endTime { get; set; }
    }

    public class ShowGoods
    {
        public int id;
        public int? type;
        public decimal? price;
        public string detail;
        public int grade;
        public string name;
        public string img;
    }

    public class CartMes
    {
        public Goods goods { get; set; }
        public Cart cart { get; set; }
    }

    public class Apply
    {
        public int o_id { get; set; }
        public string C_Name { get; set; }
        public string T_Name { get; set; }
        public string C_Address { get; set; }
        public string T_Address { get; set; }
        public string T_Phone { get; set; }

    }

}
